Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenate packet to send single USB URB transfer #19

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

znog77
Copy link
Contributor

@znog77 znog77 commented Feb 23, 2016

I attempted to use xmodem to upload firmware to a microcontroller. The CDC USB device programmed into the microcontroller expects the whole data packet (header+data+CRC) to be into a single URB (USB packet) so it did not work as it was. It was easily solved by forming a single packet concatenating the three strings. Note that the buggy implementation is actually that of the microcontroller.

It should not affect non-USB transmissions.

Concatenate header, data and crc so it is sent in a single URB. Some
embedded applications using USB CDC may expect the whole packet in a single USB
single USB Bluk transfer.
@jquast
Copy link
Collaborator

jquast commented Feb 23, 2016

In the theory of "file streams" this should not really fix anything, but if it helps you, there's no reason we can't have this change. I approve

@znog77
Copy link
Contributor Author

znog77 commented Feb 23, 2016

I actually had to use Wireshark and compare with what sx was doing. When the parts are sent separately the three USB packets can be seen. If all are sent in one single call, a single USB packet is sent. In my case, this makes xmodem work with Silicon Labs EFM32 (ARM) USB bootloader. It may be useful to others too.

@jquast jquast self-assigned this Mar 8, 2016
@jquast
Copy link
Collaborator

jquast commented Mar 8, 2016

I'll task myself to merge, version bump, add to changes file, and publish to pypi within a day or so.

@jquast jquast mentioned this pull request Mar 11, 2016
@jquast jquast merged commit e5fa53e into tehmaze:master Mar 11, 2016
@jquast
Copy link
Collaborator

jquast commented Mar 11, 2016

This is ready for release, we're just waiting the package maintainer to run the pypi command or delegate access, best wishes!

@tehmaze
Copy link
Owner

tehmaze commented Mar 11, 2016

Thanks for the PR, version 0.4.3 has been released to PyPi.

@znog77
Copy link
Contributor Author

znog77 commented Mar 11, 2016

Thank you guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants